<?php
class Plugin_Layout extends Zend_Controller_Plugin_Abstract {

    private $_view = null;

    public function __construct($view) {
        $this->_view = $view;
    }

    public function preDispatch(Zend_Controller_Request_Abstract $request) {
    	$module = $request->getModuleName();
        $resource = $request->getControllerName();
        $action = $request->getActionName();

        switch ($resource){
            case "authentication":
                $this->_view->setLayout('login');
            break;
            default:
                $this->_view->setLayout(Zend_Registry::get('defaultLayout'));
        }

    }
}
